<template>
  <el-dialog
    :title="$t('message.ddxq')"
    :visible.sync="isShow"
    :close-on-click-modal="modalDialog"
    :close-on-press-escape="modalDialog"
    width="80%"
  >
    <div class="dialog_wrap">
      <div class="title">{{ $t('message.ddxq') }}</div>
      <div class="wrap">
        <div class="item">
          <span class="key">{{ $t('message.ddbh') }}：</span>
          <span class="value">{{ detail.orderId }}</span>
        </div>
        <div class="item">
          <span class="key">{{ $t('message.ddzt') }}：</span>
          <span v-if="detail.payStatus == 0">{{ $t('message.wzf') }}</span>
          <span v-else-if="detail.payStatus == 1">{{ $t('message.cswzf') }}</span>
          <span v-else-if="detail.payStatus == 2">{{ $t('message.yqx') }}</span>
          <span v-else-if="detail.payStatus == 3">{{ $t('message.ypay') }}</span>
          <span v-else-if="detail.payStatus == 4">{{ $t('message.tkz') }}</span>
          <span v-else>{{ $t('message.ytk') }}</span>
        </div>
        <div class="item">
          <span class="key">{{ $t('message.xdqd') }}：</span>
          <span class="value">{{ detail.channelType == '01' ? $t('message.xcxd') : $t('message.cgd') }}</span>
        </div>
        <div class="item">
          <span class="key">{{ $t('message.ddje') }}：</span>
          <span class="value">{{ detail.allPrice }}</span>
        </div>
        <div class="item">
          <span class="key">{{ $t('message.sfje') }}：</span>
          <span class="value">{{ detail.realPrice }}</span>
        </div>
        <div class="item">
          <span class="key">{{ $t('message.yhje') }}：</span>
          <span class="value">{{ detail.yhMoney }}</span>
        </div>
        <div class="item">
          <span class="key">{{ $t('message.zffs') }}：</span>
          <span class="value">{{ detail.payMethod }}</span>
        </div>
        <div class="item">
          <span class="key">{{ $t('message.xdsj') }}：</span>
          <span class="value">{{ detail.createTime }}</span>
        </div>
        <div class="item">
          <span class="key">{{ $t('message.paytime') }}：</span>
          <span class="value">{{ detail.payTime }}</span>
        </div>
        <div class="item">
          <span class="key">{{ $t('message.sjh') }}：</span>
          <span class="value">{{ detail.memberPhone }}</span>
        </div>
        <div class="item">
          <span class="key">{{ $t('message.hyxm') }}：</span>
          <span class="value">{{ detail.memberName }}</span>
        </div>

        <div class="item">
          <span class="key">{{ $t('message.canqu') }}：</span>
          <span class="value">{{ detail.areaName }}</span>
        </div>
        <div class="item">
          <span class="key">{{ $t('message.canzhuo') }}：</span>
          <span class="value">{{ detail.tableName }}</span>
        </div>
      </div>
      <div class="wrap mb10">
        <span class="key">{{ $t('message.bz') }}：</span>
        <span class="value">{{ detail.note }}</span>
      </div>
      <div class="wrap">
        <div class="item">
          <span class="key">{{ $t('message.tksj') }}：</span>
          <span class="value">{{ detail.refoundTime }}</span>
        </div>
        <div class="item">
          <span class="key">{{ $t('message.tkje') }}：</span>
          <span class="value">{{ detail.refoundMoney }}</span>
        </div>
      </div>
      <div class="title">{{ $t('message.spxx') }}</div>
      <el-table
        :data="detail.detailList"
        border
        fit
        :header-row-class-name="'table-header'"
        class="doumee-element-table"
      >
        <el-table-column
          align="center"
          :label="$t('message.spmc')"
          prop="goodsName"
          min-width="120"
          show-overflow-tooltip
        />
        <el-table-column
          align="center"
          :label="$t('message.spfl')"
          prop="categoryName"
          min-width="120"
          show-overflow-tooltip
        />
        <el-table-column
          align="center"
          :label="$t('message.txm')"
          prop="barCode"
          min-width="120"
          show-overflow-tooltip
        />
        <el-table-column
          align="center"
          :label="$t('message.guige')"
          prop="goodsSkuInfo"
          min-width="120"
          show-overflow-tooltip
        />
        <el-table-column
          align="center"
          :label="$t('message.num')"
          prop="num"
          min-width="120"
          show-overflow-tooltip
        />
        <el-table-column
          align="center"
          :label="$t('message.xsjy')"
          prop="price"
          min-width="120"
          show-overflow-tooltip
        />
        <el-table-column
          align="center"
          :label="$t('message.xjy')"
          prop="amount"
          min-width="120"
          show-overflow-tooltip
        />
      </el-table>
      <div class="mt30" />
    </div>

  </el-dialog>
</template>

<script>
import store from '@/store'

import { goodsOrderDetail } from '@/api'
export default {
  data() {
    return {
      isShow: false,
      detail: {},
      modalDialog: store.getters.dialog
    }
  },
  methods: {
    getOrderDetail(id) {
      goodsOrderDetail({ param: { id }}).then(res => {
        this.detail = { ...res.record }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
  .dialog_wrap{
    .title{
      font-size: 16px;
      font-weight: 800;
      margin: 20px 0px;
    }
    .wrap{
      display: flex;
      flex-wrap: wrap;
      .item{
        width: 33.33%;
        margin-bottom: 10px;
      }
    }
  }
</style>
